//
//  ICrEAMTool.h
//  ICrEAM
//
//  Created by mac on 16/10/28.
//  Copyright © 2016年 mac. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "ParameterRespose.h"
#import "PopoverSelectionViewController.h"

#import "BrandSeriesResponse.h"
@class ICMTitleTextFeildView;

#define HomePagePath @"HomePagePath"
#define CustomName @"CustomName"
#define HomePageNotification @"HomePageNotification"

typedef enum{
    GetCarPrintType, //接车打印
    ProxyPrintType, //委托书打印
    BalancePrintType //结算打印
}PrintType;

typedef enum{
    YuanUpRoundWayType, //精确到元只进不舍
    YuanDefualtRoundWayType,//精确到四舍五入
    YuanDownRoundWayType,//精确到元只舍不入
    JiaoUpRoundWayType, //精确到角
    JiaoDefaultRoundWayType,
    JiaoDownRoundWayType,
    FenRoundWayType //精确到分
}RoundWayType;
@interface ICrEAMTool : NSObject

+(BOOL)convertAMR:(NSString *)amrFilePath
             toWAV:(NSString *)wavFilePath;

+(BOOL)convertWAV:(NSString *)wavFilePath
             toAMR:(NSString *)amrFilePath;

+(SeriesModel *)querySeriesModelWithSerieCode:(NSString *)seriesCode;
+(TMModel *)queryTMModelWithSerieCode:(NSString *)seriesCode ModelCode:(NSString *)modelCode;
/**
 *  保存最近操作车辆的信息，传入首页
 **/
+(void)savaOperationReceiptUserName:(NSString *)userName carSeries:(NSString*)series licence:(NSString *)licence status:(NSString *)status returnTime:(NSString *)returnTime;

//是否是大众登陆
+(BOOL)isVW;
+(BOOL)isZoreText:(NSString *)text;

//判断手机号正则表达式
+(BOOL)isPhoneNumber:(NSString *)phone;
//输入数字表达式
+(BOOL)ismileageText:(NSString *)mileageText;
//判断车牌号正则表达式
+(BOOL)isCarNumText:(NSString *)carText;
//判断Vin正则表达式
+(BOOL)isVinText:(NSString *)vin;

//获取维修排序类型
+(NSArray*)queryRepairOrderTypes;
//获取维修类型
+(NSArray*)getRepiarTypeArray;

//获取维修类型的编码
+ (NSString *)getRepiarTypeCodeWithRepiarName:(NSString *)repiarName;
//获取维修类型的描述
+ (NSString *)getRepiarTypeDescWithRepiarCode:(NSString *)code;
/**
 *  车牌号前缀
 **/
+(NSArray*)getLicencePrefixArray;

+(NSArray*)getProvinceCityArray;//获取省份城市 ProvinceCityRespose

+(NSArray*)getParameterArrayWithCode:(NSString *)code; //根据code获取对应的字典参数 前4位

+(NSArray*)getParameterTitleArrayWithArray:(NSArray *)array; //根据4位code获取对应的中文选项
+(NSArray*)getParameterCodeArrayWithArray:(NSArray *)array;
//获取品牌车系数组  BrandSeriesResponse
+(NSArray *)queryBrandSeries;
//获取大分类小分类  IndustryResponse
+(NSArray *)queryIndustry;
//根据code获得描述
+(ParameterModel*)getParameterWithCode:(NSString*)detailCode;
+ (ParameterModel *)getCodeModelForCode:(NSString *)code;

//+(ParameterModel*)getParameterWithCode:(NSString*)detailCode; //8位code
+(NSString*)getDeatilCodeWithParameterDesc:(NSString*)desc withCode:(NSString*)code; //根据汉子获取8位码
//UIColor->UIImage
+(UIImage *)imageWithColor:(UIColor *)color size:(CGSize)size;

//yyyy-mm-dd hh:mm 转成date
+ (NSDate *)getDateWithDateDesc:(NSString *)dateDesc;

//时间戳字符串转小时和分钟
+ (NSString *)getDateHourAndMinuteWithTimeInterval:(NSString *)dateString;
+ (NSString *)getDateHourMinuteWithTimeInterval:(NSString *)dateString;


+(NSString *)dateToString:(NSDate *)date;
+(NSDate *)stringToDate:(NSString *)dateString;
+(NSDate *)tomorrowDate;
+(NSDate *)getLocalFromUTC:(NSString *)utc;
+(NSString *)getLocalDateFormateUTCDate:(NSString *)utcDate;
+(NSDate *)getNowDateFromatAnDate:(NSDate *)anyDate;
//时间转字符串
+(NSString *)getStringWithDate:(NSDate *)date;
//时间戳转日期
+(NSString *)getDateWithTimeInterval:(NSString *)date;
//yyyy-mm-dd hh:mm
+(NSString *)getDateHourAndMinWithTimeInterval:(NSString *)date;
//yyyy-mm-dd hh:mm:ss
+(NSString *)getDateHourAndMinSecondWithTimeInterval:(NSString *)date;
//获取当前日期
+(NSString *)getNowDate;
+ (NSString *)getNowDateAndHour_Min;

//判断数组中是否有其他数组中的元素
+ (BOOL)array:(NSArray*)array hasItemInOtherArray:(NSArray*)otherArray;


+ (void)showPopoverSelectionViewWithSourceView:(UIView *)sourceView displayWidth:(CGFloat)width displayHeight:(CGFloat)height dataArray:(NSMutableArray *)dataArray delegate:(id<PopoverSelectionViewControllerDelegate>)delegate showType:(PopoverSelectionViewShowType)showType;

+ (void)showPopoverSelectionViewWithSourceView:(UIView *)sourceView displayWidth:(CGFloat)width displayHeight:(CGFloat)height dataArray:(NSMutableArray *)dataArray delegate:(id<PopoverSelectionViewControllerDelegate>)delegate showType:(PopoverSelectionViewShowType)showType IsMultiSelect:(BOOL)isMultiSelect WithSelectedStr:(NSString *)str WithPermittedArrowDirections:(NSString *)direct;
//圆整方式

+ (NSString*)resultAboutAmoun:(CGFloat)f;

/************根据类型，和所对应的id进行打印**************/
+(void)ipadPrintWithPrintType:(PrintType)type printId:(NSString*)printId Controller:(UIViewController *)ctr andEstimatePrice:(NSString *)price;

// 增大button点击热区
+ (void)createAndAddBiggerButtonForButton:(UIButton*)button andSEL:(SEL)selector target:(id)target addTop:(float)top bottom:(float)bottom left:(float)left right:(float)right inView:(UIView *)superView;

//校验身份证
+ (BOOL)judgeIdentityStringValid:(NSString *)identityString;

+ (BOOL)isEmptyForContentText:(ICMTitleTextFeildView*)textFeildView;
+ (BOOL)validateMobile:(NSString *)mobile;
+ (BOOL)isVaildCompanyName:(NSString *)companyName;
+ (BOOL)isVaildRealName:(NSString *)realName;
+ (BOOL)isValidEntpCode:(NSString *)code;
//去空格
+ (NSString *)trimWhitespace:(NSString *)val;
@end
